< previous page page_327 next page >

Page 327
Table 11.1 Equations for the Curves in Figure 11.2
PROGRAMX(T)Y(T)VALUES OF T
Spiral7 * t2/350 * Cos(t)7 * t2/350 * Sin(t)0 <= t<=6 * p
Bditch2000 * Sin(4*t)2000 * Sin(5*t)0 <= t<=2 * p
Cycloid2000 * (27 * Cos(t)
+ 15 * Cos(t * 20/7)) / 42
2000 * (27 * Sin(t)
+ 15 * Sin(t * 20/7)) / 42
0 <= t<=14 * p

e10a6a0a59f035e870d90cca05b85fce.gif
        pic.Line -(cx + x_scale * X(t), cy + y_scale * Y(t)) 
        t = t + dt
    Loop

    pic.Line -(cx + x_scale * X(stop_t), _
        cy + y_scale * Y(stop_t))
End Sub
Example program Circle2 uses this code to display stretched circles. Enter the scale factors and click the Go button. The program adjusts the circle's radius and center to keep the ellipse in the middle of the picture box.
Figure 11.3 shows a circle drawn by the Circle2 program. In this picture, the points have been scaled by a factor of 0.5 in the Y direction, making the circle appear squashed.
Rotating Points
Another way you can transform a curve is to rotate each of its points. If you want to rotate the points by an angle of q radians, transform the X and Y coordinates of each point like this:
e10a6a0a59f035e870d90cca05b85fce.gif
new X(t) = X(t) * Cos(q) - Y(t) * Sin(q)
new Y(t) = X(t) * Sin(
q) + Y(t) * Cos(q)
z0347-01.gif
Figure 11.3
A circle scaled by a factor of 0.5 in the Y direction.

 
< previous page page_327 next page >